﻿using Newtonsoft.Json;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace PLM.ConfigurationCenter.EventBus.Eventbus {
    /// <summary>
    /// 事件模型
    /// </summary>
    public class IntegrationEvent {
        /// <summary>
        /// 构造函数
        /// </summary>
        public IntegrationEvent() {
            Id = Guid.NewGuid();
            CreationDate = DateTime.UtcNow;
        }
        /// <summary>
        /// 构造函数
        /// </summary>
        /// <param name="id"></param>
        /// <param name="createDate"></param>
        [JsonConstructor]
        public IntegrationEvent(Guid id, DateTime createDate) {
            Id = id;
            CreationDate = createDate;
        }
        /// <summary>
        /// 事件主键
        /// </summary>
        [JsonProperty]
        public Guid Id { get; private set; }
        /// <summary>
        /// 创建时间
        /// </summary>
        [JsonProperty]
        public DateTime CreationDate { get; private set; }
    }
}
